home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / editor / wabd101.zip / WABD101.ZIP / PoolDemo / Admin.pas < prev    next >
Pascal/Delphi Source File  |  1997-02-23  |  3KB  |  132 lines

  1. unit Admin;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.    HTMLForm, StdCtrls, HTMLFormSection, ExtCtrls, HTMLHeader;
  8.  
  9. type
  10.   TAdminForm = class(THTMLForm)
  11.     HTMLHeader1: THTMLHeader;
  12.     HTMLFormSection1: THTMLFormSection;
  13.     Label1: TLabel;
  14.     UsersBut: TButton;
  15.     LogOffBut: TButton;
  16.     RecreateTabBut: TButton;
  17.     StatLab: TLabel;
  18.     TeamsBut: TButton;
  19.     GamesBut: TButton;
  20.     Label3: TLabel;
  21.     WeeksBut: TButton;
  22.     PicksBut: TButton;
  23.     PlayerWeekBut: TButton;
  24.     GlobalsBut: TButton;
  25.     Label2: TLabel;
  26.     DeleteTabBut: TButton;
  27.     Label4: TLabel;
  28.     procedure LogOffButClick(Sender: TObject);
  29.     procedure RecreateTabButClick(Sender: TObject);
  30.     procedure UsersButClick(Sender: TObject);
  31.     procedure TeamsButClick(Sender: TObject);
  32.     procedure GamesButClick(Sender: TObject);
  33.     procedure WeeksButClick(Sender: TObject);
  34.     procedure PicksButClick(Sender: TObject);
  35.     procedure PlayerWeekButClick(Sender: TObject);
  36.     procedure GlobalsButClick(Sender: TObject);
  37.     procedure DeleteTabButClick(Sender: TObject);
  38.   private
  39.     { Private declarations }
  40.   public
  41.     { Public declarations }
  42.   end;
  43.  
  44.  
  45. implementation
  46.  
  47. uses PoolGlobals, TableEdit;
  48.  
  49. {$R *.DFM}
  50.  
  51. procedure TAdminForm.LogOffButClick(Sender: TObject);
  52. begin
  53.    EndSession('Admin Logged Off');
  54. end;
  55.  
  56. procedure TAdminForm.RecreateTabButClick(Sender: TObject);
  57. begin
  58.    Globals(self).PoolData.CreateTables;
  59.    StatLab.Caption := 'Finished Creating Tables';
  60. end;
  61.  
  62. procedure TAdminForm.UsersButClick(Sender: TObject);
  63. begin
  64.    with Globals(self) do begin
  65.       TableEdit := PoolData.UserTable;
  66.       PoolData.UserTable.First;
  67.       ShowFormType(TTableEditForm);
  68.    end;
  69. end;
  70.  
  71. procedure TAdminForm.TeamsButClick(Sender: TObject);
  72. begin
  73.    with Globals(self) do begin
  74.       TableEdit := PoolData.TeamsTable;
  75.       PoolData.TeamsTable.First;
  76.       ShowFormType(TTableEditForm);
  77.    end;
  78. end;
  79.  
  80. procedure TAdminForm.GamesButClick(Sender: TObject);
  81. begin
  82.    with Globals(self) do begin
  83.       TableEdit := PoolData.GamesTable;
  84.       PoolData.GamesTable.First;
  85.       ShowFormType(TTableEditForm);
  86.    end;
  87. end;
  88.  
  89. procedure TAdminForm.WeeksButClick(Sender: TObject);
  90. begin
  91.    with Globals(self) do begin
  92.       TableEdit := PoolData.WeeksTable;
  93.       PoolData.WeeksTable.First;
  94.       ShowFormType(TTableEditForm);
  95.    end;
  96. end;
  97.  
  98. procedure TAdminForm.PicksButClick(Sender: TObject);
  99. begin
  100.    with Globals(self) do begin
  101.       TableEdit := PoolData.PicksTable;
  102.       PoolData.PicksTable.First;
  103.       ShowFormType(TTableEditForm);
  104.    end;
  105. end;
  106.  
  107. procedure TAdminForm.PlayerWeekButClick(Sender: TObject);
  108. begin
  109.    with Globals(self) do begin
  110.       TableEdit := PoolData.PlayerWeeksTable;
  111.       PoolData.PlayerWeeksTable.First;
  112.       ShowFormType(TTableEditForm);
  113.    end;
  114. end;
  115.  
  116. procedure TAdminForm.GlobalsButClick(Sender: TObject);
  117. begin
  118.    with Globals(self) do begin
  119.       TableEdit := PoolData.GlobalsTable;
  120.       PoolData.GlobalsTable.First;
  121.       ShowFormType(TTableEditForm);
  122.    end;
  123. end;
  124.  
  125. procedure TAdminForm.DeleteTabButClick(Sender: TObject);
  126. begin
  127.    Globals(self).PoolData.DeleteTables;
  128.    StatLab.Caption := 'Finished Deleting Tables';
  129. end;
  130.  
  131. end.
  132.